<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class MessageModel extends Model
{
  
    /**
     * 与模型关联的数据表。
     *
     * @var string
     */
    protected $table = 'ad_message';
    
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'usertype', 
        'userid', 
        'title',
        'pic1',
        'pic2',
        'pic3',
        'pic4',
        'pic5',
        'pic6',
        'pic7',
        'pic8',
        'pic9',
        'isvideo',
        'video',
        'video_pic',
        'readcount',
        'praisecount',
        'disscusscount',
        'more',
        'status',
        'statustime',
        'createtime'
    ];
    
    
    /**
     * 指定是否模型应该被戳记时间。
     *
     * @var bool
     */
    public $timestamps = false;
    
    public function belongsToAd()
    
    {
        
        return $this->belongsTo('Ad', 'id', 'ctxid');
        
    }
}
